<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/jstl/fn" prefix="fn"%>
<!DOCTYPE html>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()+ path + "/";
%>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1 user-scalable=0">
    <link rel="stylesheet" href="<%=basePath%>assets/css/public.css">
	<link rel="stylesheet" href="<%=basePath%>assets/css/page.css">
	<link rel="stylesheet"
	href="<%=basePath%>assets/font-awesome-4.7.0/css/font-awesome.min.css">
    <title>登录</title>
    <script src="<%=basePath%>assets/js/jquery-1.8.3.min.js"></script>
    <script src="<%=basePath%>assets/js/fontSize.js"></script>
    <script src="<%=basePath%>assets/layer/mobile/layer.js"></script>
<style>

body{
	padding-top:0.8rem;
}

.dengluIndexBox, .zhuceBox, .dengluBox, .wangjimimaBox,
	.shoujihaomayanzheng, .zcshoujihaomayanzheng {
	display: none;
}

.dengluIndexBox {
	display: block;
}

.dengluLogo {
	width: 24%;
	padding: 1rem 38% 1rem;
	display: block
}

.dengluanniu, .zhuceanniu {
	width: 80%;
	border-radius: 0.3rem;
	height: 0.6rem;
	line-height: 0.7rem;
	background: #fff;
	border: 1px solid #FF3F25;
	display: block;
	margin: 0.3rem 10%;
	text-align: center;
	font-size: 0.24rem;
	color: #FF3F25
}

.youkeanniu {
	color: #4aa8f0;
	text-align: center;
	text-decoration: underline;
	font-size: 0.2rem;
	line-height: 0.4rem
}

.qitadlfs, #qitadlfs2, #qitadlfs3, #qitadlfs4, #qitadlfs5 {
	width: 80%;
	margin: 0 10%;
	position: fixed;
	left: 0;
	bottom: 5%
}

.qitadlfs p, #qitadlfs2 p, #qitadlfs3 p, #qitadlfs4 p, #qitadlfs5 p {
	width: 100%;
	font-size: 0.22rem;
	text-align: center;
	height: 0.4rem;
	line-height: 0.4rem;
}

.qitadlfs ul li, #qitadlfs2 ul li, #qitadlfs3 ul li, #qitadlfs4 ul li,
	#qitadlfs5 ul li {
	width: 25%;
	float: left
}

.qitadlfs ul li img, #qitadlfs2 ul li img, #qitadlfs3 ul li img,
	#qitadlfs4 ul li img, #qitadlfs5 ul li img {
	width: 60%;
	margin: 20%;
	border-radius: 50%;
	border: 1px solid #ccc
}

.qitadlfs ul li p, #qitadlfs2 ul li p, #qitadlfs3 ul li p, #qitadlfs4 ul li p,
	#qitadlfs5 ul li p {
	width: 100%;
	height: 0.3rem;
	line-height: 0.3rem;
	text-align: center;
	font-size: 0.2rem;
}

.zhuceBox .content input {
	width: 76%;
	margin: 0.2rem 5%;
	height: 0.6rem;
	line-height: 0.6rem;
	border-bottom: 1px solid #cccccc;
	padding: 0 2% 0 10%
}

.zhuceBox .content input.sjshuru {
	background: url("<%=basePath%>assets/images/shouji.png") no-repeat left
		0.1rem;
	background-size: 7%
}

.zhuceBox .content input.mimashuru {
	background: url("<%=basePath%>assets/images/suo.png") no-repeat left
		0.1rem;
	background-size: 6%
}

.zhuceBox .content .sjcuowu, .zhuceBox .content .mmcuowu {
	display: none;
	width: 86%;
	margin: 0 5%;
	height: 0.4rem;
	line-height: 0.4rem;
	padding: 0 2%;
	color: red
}

.xiayibu {
	width: 80%;
	border-radius: 0.3rem;
	height: 0.6rem;
	line-height: 0.6rem;
	background: #FF3F25;
	display: block;
	margin: 0.3rem 10%;
	text-align: center;
	font-size: 0.24rem;
	color: #fff;
	border: none;
	outline：none
}

.xiayibu:focus {
	outline: 0;
}

.dengluBox .content input {
	width: 76%;
	margin: 0.2rem 5%;
	height: 0.6rem;
	line-height: 0.6rem;
	border-bottom: 1px solid #cccccc;
	padding: 0 2% 0 10%
}

.dengluBox .content input.sjshuru {
	background: url("<%=basePath%>assets/images/shouji.png") no-repeat left
		0.1rem;
	background-size: 7%
}

.dengluBox .content input.mimashuru {
	background: url("<%=basePath%>assets/images/suo.png") no-repeat left
		0.1rem;
	background-size: 6%
}

.dengluBox .content .sjcuowu, .dengluBox .content .mmcuowu {
	display: none;
	width: 86%;
	margin: 0 5%;
	height: 0.4rem;
	line-height: 0.4rem;
	padding: 0 2%;
	color: red
}

.dengluBox .content .wangjimima {
	width: 80%;
	padding: 0 10%;
	color: #4aa8f0;
	text-decoration: underline;
	font-size: 0.2rem;
	line-height: 0.4rem;
	text-align: right
}

.wangjimimaBox .header p {
	font-size: 0.26rem;
	line-height: 0.9rem;
	height: 0.9rem;
	color: #fff
}

.wangjimimaBox .content input {
	width: 76%;
	margin: 0.2rem 5%;
	height: 0.6rem;
	line-height: 0.6rem;
	border-bottom: 1px solid #cccccc;
	padding: 0 2% 0 10%
}

.wangjimimaBox .content input.sjshuru {
	background: url("<%=basePath%>assets/images/shouji.png") no-repeat left
		0.1rem;
	background-size: 7%
}

.wangjimimaBox .content input.mimashuru {
	background: url("<%=basePath%>assets/images/suo.png") no-repeat left
		0.1rem;
	background-size: 6%
}

.wangjimimaBox .content .sjcuowu, .wangjimimaBox .content .mmcuowu {
	display: none;
	width: 86%;
	margin: 0 5%;
	height: 0.4rem;
	line-height: 0.4rem;
	padding: 0 2%;
	color: red
}

.shoujihaomayanzheng .header a img {
	width: 100%;
	height: 100%;
}

.shoujihaomayanzheng .header p {
	font-size: 0.26rem;
	line-height: 0.9rem;
	height: 0.9rem;
	color: #fff
}

.shoujihaomayanzheng .content p {
	width: 90%;
	padding: 0 5%;
	height: 0.8rem;
	line-height: 0.8rem;
	font-size: 0.24rem;
}

.shoujihaomayanzheng .content input.sjshuru {
	width: 55%;
	margin: 0.2rem 0 0.2rem 5%;
	line-height: 0.6rem;
	border-bottom: 1px solid #cccccc;
	padding: 0 2% 0 8%;
	background: url("<%=basePath%>assets/images/yaoshi.png") no-repeat left
		0.1rem;
	background-size: 8%;
	display: block;
	float: left
}

.shoujihaomayanzheng .content input.daojishi {
	width: 25%;
	margin: 0.2rem 0;
	height: 0.6rem;
	line-height: 0.6rem;
	border-bottom: 1px solid #cccccc;
	display: block;
	float: left;
	font-size: 0.22rem;
	text-align: center;
	background: #fff
}

.zcshoujihaomayanzheng .header a img {
	width: 100%;
	height: 100%;
}

.zcshoujihaomayanzheng .header p {
	font-size: 0.26rem;
	line-height: 0.9rem;
	height: 0.9rem;
	color: #fff
}

.zcshoujihaomayanzheng .content p {
	width: 90%;
	padding: 0 5%;
	height: 0.8rem;
	line-height: 0.8rem;
	font-size: 0.24rem;
}

.zcshoujihaomayanzheng .content input.sjshuru {
	width: 55%;
	margin: 0.2rem 0 0.2rem 5%;
	line-height: 0.6rem;
	border-bottom: 1px solid #cccccc;
	padding: 0 2% 0 8%;
	background: url("<%=basePath%>assets/images/yaoshi.png") no-repeat left 0.1rem;
	background-size: 8%;
	display: block;
	float: left
}

.zcshoujihaomayanzheng .content input.daojishi {
	width: 25%;
	margin: 0.2rem 0;
	height: 0.6rem;
	line-height: 0.6rem;
	border-bottom: 1px solid #cccccc;
	display: block;
	float: left;
	font-size: 0.22rem;
	text-align: center;
	background: #fff
}
</style>
</head>
<body>
<div class="dengluIndexBox">
    <img src="<%=basePath%>/assets/css/aboutUs/logo.png" alt="" class="dengluLogo">
    <a href="javascript:;" class="dengluanniu">手机号登录</a>
    <a href="javascript:;" class="zhuceanniu">注册</a>
    <p class="youkeanniu" onclick="javascript:window.location.href='<%=basePath%>app/appIndex'">游客试用</p>

<!--     <div class="qitadlfs"> -->
<!--         <p>--------------其他登录方式--------------</p> -->
<!--         <ul> -->
<!--             <li> -->
<%--                 <img src="<%=basePath%>assets/images/timg.jpg" alt=""> --%>
<!--                 <p>微信</p> -->
<!--             </li> -->
<!--             <li> -->
<%--                 <img src="<%=basePath%>assets/images/timg.jpg" alt=""> --%>
<!--                 <p>微信</p> -->
<!--             </li> -->
<!--             <li> -->
<%--                 <img src="<%=basePath%>assets/images/timg.jpg" alt=""> --%>
<!--                 <p>微信</p> -->
<!--             </li> -->
<!--             <li> -->
<%--                 <img src="<%=basePath%>assets/images/timg.jpg" alt=""> --%>
<!--                 <p>微信</p> -->
<!--             </li> -->
<!--         </ul> -->
<!--     </div> -->
</div>
<div class="zhuceBox">
    <div class="header clearFirx">
        <a href="javascript:;" class="returnInfo" onclick="fanhui()"><i class="fa fa-angle-left"></i></a>手机号注册
    </div>
    <div class="content">
        <input type="number" autofocus class="sjshuru" placeholder="请输入手机号码" maxlength="11" id="zcUserName">
        <input type="passWord" class="mimashuru" placeholder="设置登录密码，不少于6位" id="zcPassword">
        <a href="javascript:;" class="xiayibu" id="zcxyb">下一步</a>

    </div>
<!--     <div id="qitadlfs2"> -->
<!--         <p>--------------其他注册方式--------------</p> -->
<!--         <ul> -->
<!--             <li> -->
<%--                 <img src="<%=basePath%>assets/images/timg.jpg" alt=""> --%>
<!--                 <p>微信</p> -->
<!--             </li> -->
<!--             <li> -->
<%--                 <img src="<%=basePath%>assets/images/timg.jpg" alt=""> --%>
<!--                 <p>微信</p> -->
<!--             </li> -->
<!--             <li> -->
<%--                 <img src="<%=basePath%>assets/images/timg.jpg" alt=""> --%>
<!--                 <p>微信</p> -->
<!--             </li> -->
<!--             <li> -->
<%--                 <img src="<%=basePath%>assets/images/timg.jpg" alt=""> --%>
<!--                 <p>微信</p> -->
<!--             </li> -->
<!--         </ul> -->
<!--     </div> -->

</div>
<div class="dengluBox">
    <div class="header clearFirx">
        <a href="javascript:;" class="returnInfo" onclick="fanhui()"><i class="fa fa-angle-left"></i></a>手机号登录
    </div>
    <div class="content">
	    <form action="<%=basePath %>app/app_j_spring_security_check"  onsubmit="return check()" class="form-validation" method="post">
	        <input autofocus type="number" class="sjshuru" placeholder="请输入手机号" id="dlUserName" name="username" maxlength="11">
	        <input type="passWord" class="mimashuru" placeholder="请输入密码" id="dlPassword" name="password">
	        <p class="wangjimima" id="wangjimima">忘记密码</p>
	        <button type="submit" class="xiayibu" id="dengluNext">登录</button>
		</form>
    </div>
</div>
<div class="wangjimimaBox">
    <div class="header clearFirx">
        <a href="javascript:;" class="returnInfo" onclick="fanhui2()"><i class="fa fa-angle-left"></i></a>
        	忘记密码
    </div>
    <div class="content">
        <input type="number" class="sjshuru" placeholder="请输入手机号" id="wjmmUserName" maxlength="11">
        <input type="passWord" class="mimashuru" placeholder="设置登录密码，不少于6位" id="wjmmPassword">
        <a href="javascript:;" class="xiayibu" id='wangjixyb'>下一步</a>

    </div>
</div>
<!-- 忘记密码验证码 -->
<div class="shoujihaomayanzheng">
    <div class="header clearFirx">
        <a href="javascript:;" class="returnInfo" onclick="fanhui3()"><i class="fa fa-angle-left"></i></a>
        <p>手机号验证</p>
    </div>
    <div class="content">
        <p>你会收到一条手机验证码短信，请输入验证码：</p>
        <input type="text" class="sjshuru" id="wjmmyzm" placeholder="请输入验证码">
        <input type="button" class="daojishi" id="wjmmdaojishi" value="重新获取" onclick="wjmmsendemail()" />
        <div class="clear"></div>
        <a href="javascript:;" class="xiayibu" id="btnwjmm">下一步</a>
    </div>
</div>
<!-- 注册的验证码 -->
<div class="zcshoujihaomayanzheng">
    <div class="header clearFirx">
        <a href="javascript:;" class="returnInfo" onclick="fanhui4()"><i class="fa fa-angle-left"></i></a>
        <p>手机号验证</p>
    </div>
    <div class="content">
        <p>你会收到一条手机验证码短信，请输入验证码：</p>
        <input type="text" class="sjshuru" id="zcyzm" placeholder="请输入验证码">
        <input type="button" class="daojishi" id="zcdaojishi" value="重新获取" onclick="zcsendemail()" />
        <div class="clear"></div>
        <a href="javascript:;" class="xiayibu" id="btnRegister" onclick="btnRegister()">下一步</a>
    </div>
</div>
</body>
<script>
	$(function () {
	  	$('.dengluLogo').height($('.dengluLogo').width());
	  	$('.qitadlfs ul li img').height($('.qitadlfs ul li img').width());
	  	$('#qitadlfs2 ul li img').height($('#qitadlfs2 ul li img').width());
	  	$('#qitadlfs4 ul li img').height($('#qitadlfs4 ul li img').width());
	  	$('#qitadlfs5 ul li img').height($('#qitadlfs5 ul li img').width());
	  	
	  	var error = '${SPRING_SECURITY_LAST_EXCEPTION.message}';
		if(error && typeof(error)!='undefined' && error!=''){
			layer.open({
			    content: '用户名或密码错误'
		    	,skin: 'msg'
			    ,time: 2 //2秒后自动关闭
		  	});
		}
		$("#registerForm").hide();
		$("#volatileCodeBtn").attr("onclick","getVolatileCode()");
		$('#subRegistet').bind("click",function(){
			subRegister();
		});
		<% session.removeAttribute("SPRING_SECURITY_LAST_EXCEPTION");%>
	});
	
	//返回首页
 	function fanhui() {
  		$('.dengluIndexBox').css('display','block');
        $('.dengluIndexBox').siblings().css('display','none');
    }
	//返回登录页面
 	function fanhui2() {
  		$('.dengluBox').css('display','block');
        $('.dengluBox').siblings().css('display','none');
    }
	//返回忘记密码页面
 	function fanhui3() {
  		$('.wangjimimaBox').css('display','block');
        $('.wangjimimaBox').siblings().css('display','none');
    }
	//返回注册页面
 	function fanhui4() {
  		$('.zhuceBox').css('display','block');
        $('.zhuceBox').siblings().css('display','none');
    }

	//点击首页登录
	$('.dengluanniu').click(function () {
     	$('.dengluBox').css('display','block');
     	$('.dengluBox').siblings().css('display','none');
     	$('#qitadlfs3 ul li img').height($('#qitadlfs3 ul li img').width());
	});
	
	//点击首页注册
 	$('.zhuceanniu').click(function () {
     	$('.zhuceBox').css('display','block');
     	$('.zhuceBox').siblings().css('display','none');
     	$('#qitadlfs2 ul li img').height($('#qitadlfs2 ul li img').width());
     	
 	})
 	
 	//点击注册页面下一步
	$('#zcxyb').click(function () {
     	if($("#zcUserName").val() == ""){
			layer.open({
			    content: '请输入手机号'
		    	,skin: 'msg'
			    ,time: 2 //2秒后自动关闭
		  	});
			return false;
		}
     	if($("#zcUserName").val().match(/^1[3|4|5|6|7|8][0-9]\d{4,8}$/)==null || $("#zcUserName").val().length!=11 ){
    		layer.open({
			    content: '请输11位数字的手机号'
		    	,skin: 'msg'
			    ,time: 2 //2秒后自动关闭
		  	});
		 	return false;
		}
		if($("#zcPassword").val() == ""){
			layer.open({
			    content: '请输入密码'
		    	,skin: 'msg'
			    ,time: 2 //2秒后自动关闭
		  	});
			return false;
		}
		if($("#zcPassword").val().length<6 ){
    		layer.open({
			    content: '请输入6位或以上的密码'
		    	,skin: 'msg'
			    ,time: 2 //2秒后自动关闭
		  	});
		 	return false;
		}
     	$('.zcshoujihaomayanzheng').css('display','block');
     	$('.zcshoujihaomayanzheng').siblings().css('display','none');
     	var obj = $("#zcdaojishi");
     	zcsettime(obj)
     	
     	$.ajax({
			 type:"POST",
	         url: "<%=basePath %>app/getAppVolatileCode?phone="+$("#zcUserName").val(),
	         success: function(data,status,xhr){
	        	if(data!=null&&data.state==1){
	        		
	        	}else{
	        		layer.open({
	    			    content: '获取验证码失败，请稍后再试'
	    		    	,skin: 'msg'
	    			    ,time: 2 //2秒后自动关闭
	    		  	});
	        	}
	         },
	         error:function(){
	         }
		})
	});
	
	function btnRegister(){
		$('#btnRegister').removeAttr('onclick');
		$.ajax({
			 type:"POST",
	         url: "<%=basePath %>app/appRegister2",
	         data: {
	        	 "phone":$("#zcUserName").val(),
	        	 "volatileCode":$("#zcyzm").val(),
	        	 "password":$("#zcPassword").val(),
	        	 "schoolId":1
	         },
	         success: function(data){
				if(data.state==1){
					layer.open({
	    			    content: '注册成功，即将跳转到主页'
	    		    	,skin: 'msg'
	    			    ,time: 5 //2秒后自动关闭
	    		  	});
					setTimeout(function(){
				  		window.location.href="<%=basePath%>app/appIndex";
				 	},5000);
					
				}else if(data.state==-1){
					layer.open({
	    			    content: '验证码不正确'
	    		    	,skin: 'msg'
	    			    ,time: 2 //2秒后自动关闭
	    		  	});
				}else if(data.state==-2){
					layer.open({
	    			    content: '该手机号已存在，你可以直接用该手机号+密码登录'
	    		    	,skin: 'msg'
	    			    ,time: 5 //2秒后自动关闭
	    		  	});
				}else{
					layer.open({
	    			    content: '注册失败'
	    		    	,skin: 'msg'
	    			    ,time: 2 //2秒后自动关闭
	    		  	});
				}  		
	         }
		})
	}
 	
	//点击忘记密码
 	$('#wangjimima').click(function () {
     	$('.wangjimimaBox').css('display','block');
     	$('.wangjimimaBox').siblings().css('display','none');
     	$('#qitadlfs4 ul li img').height($('#qitadlfs4 ul li img').width());
	})

	//点击忘记密码页面下一步
	$('#wangjixyb').click(function () {
		var state = 0;
		$.ajax({
			type:"POST",
	        url: "<%=basePath %>app/verifyLoginName",
	        async:false,
	        data: {
	       		"phone":$("#wjmmUserName").val()
	        },
	        success: function(data){
	        	state = data.state;
         	}
		})
		
     	if($("#wjmmUserName").val() == ""){
			layer.open({
			    content: '请输入手机号'
		    	,skin: 'msg'
			    ,time: 2 //2秒后自动关闭
		  	});
			return false;
		}
     	if($("#wjmmUserName").val().match(/^1[3|4|5|6|7|8][0-9]\d{4,8}$/)==null || $("#wjmmUserName").val().length!=11 ){
    		layer.open({
			    content: '请输11位数字的手机号'
		    	,skin: 'msg'
			    ,time: 2 //2秒后自动关闭
		  	});
		 	return false;
		}
		if(state == 0){
			layer.open({
			    content: '该账号未注册，请先注册',
			    skin: 'msg',
			    time: 2 //2秒后自动关闭
		  	});
			return false;
		}
		if($("#wjmmPassword").val() == ""){
			layer.open({
			    content: '请输入密码'
		    	,skin: 'msg'
			    ,time: 2 //2秒后自动关闭
		  	});
			return false;
		}
		if($("#wjmmPassword").val().length<6 ){
    		layer.open({
			    content: '请输入6位或以上的密码'
		    	,skin: 'msg'
			    ,time: 2 //2秒后自动关闭
		  	});
		 	return false;
		}
     	$('.shoujihaomayanzheng').css('display','block');
     	$('.shoujihaomayanzheng').siblings().css('display','none');
     	var obj = $("#wjmmdaojishi");
     	wjmmsettime(obj);
     	//获取验证码
     	$.ajax({
			 type:"POST",
	         url: "<%=basePath %>app/getAppVolatileCode?phone="+$("#wjmmUserName").val(),
	         success: function(data,status,xhr){
	        	if(data!=null&&data.state==1){
	        		
	        	}else{
	        		layer.open({
	    			    content: '获取验证码失败，请稍后再试'
	    		    	,skin: 'msg'
	    			    ,time: 2 //2秒后自动关闭
	    		  	});
	        	}
	         },
	         error:function(){
	         }
		})
	});
	
	//点击忘记密码验证码页面的下一步
	$("#btnwjmm").click(function(){
		$.ajax({
			 type:"POST",
	         url: "<%=basePath %>app/forgetPassword",
	         data: {
	        	 "phone":$("#wjmmUserName").val(),
	        	 "volatileCode":$("#wjmmyzm").val(),
	        	 "password":$("#wjmmPassword").val(),
	        	 "schoolId":1
	         },
	         success: function(data){
				if(data.state==1){
			  		window.location.href="<%=basePath%>app/appIndex";
					
				}else if(data.state==-1){
					layer.open({
	    			    content: '验证码不正确'
	    		    	,skin: 'msg'
	    			    ,time: 2 //2秒后自动关闭
	    		  	});
				}else{
					layer.open({
	    			    content: '密码修改失败'
	    		    	,skin: 'msg'
	    			    ,time: 2 //2秒后自动关闭
	    		  	});
				}  		
	         }
		})
	})

	function check(){
		if($("#dlUserName").val() == ""){
			layer.open({
			    content: '请输入手机号'
		    	,skin: 'msg'
			    ,time: 2 //2秒后自动关闭
		  	});
			return false;
		}
		if($("#dlPassword").val() == ""){
			layer.open({
			    content: '请输入密码'
		    	,skin: 'msg'
			    ,time: 2 //2秒后自动关闭
		  	});
			return false;
		}
	}
	
	
	//注册验证码倒计时
    var zccountdown=60;
    function zcsendemail(){
        var obj = $("#zcdaojishi");
        zcsettime(obj);
        $.ajax({
			 type:"POST",
	         url: "<%=basePath %>app/getAppVolatileCode?phone="+$("#zcUserName").val(),
	         success: function(data,status,xhr){
	        	if(data!=null&&data.state==1){
	        		
	        	}else{
	        		layer.open({
	    			    content: '获取验证码失败，请稍后再试'
	    		    	,skin: 'msg'
	    			    ,time: 2 //2秒后自动关闭
	    		  	});
	        	}
	         },
	         error:function(){
	         }
		})
    }
    function zcsettime(obj) { //发送验证码倒计时
        if (zccountdown == 0) {
            obj.attr('disabled',false);
            obj.val("重新获取");
            zccountdown = 60;
            return;
        } else {
            obj.attr('disabled',true);
            obj.val(zccountdown+"s");
            zccountdown--;
        }
        setTimeout(function() {
        	zcsettime(obj) 
       	},1000)
    }
    
  	//忘记密码验证码倒计时
    var wjmmcountdown=60;
    function wjmmsendemail(){
        var obj = $("#wjmmdaojishi");
        wjmmsettime(obj);
      	//获取验证码
     	$.ajax({
			 type:"POST",
	         url: "<%=basePath %>app/getAppVolatileCode?phone="+$("#wjmmUserName").val(),
	         success: function(data,status,xhr){
	        	if(data!=null&&data.state==1){
	        		
	        	}else{
	        		layer.open({
	    			    content: '获取验证码失败，请稍后再试'
	    		    	,skin: 'msg'
	    			    ,time: 2 //2秒后自动关闭
	    		  	});
	        	}
	         },
	         error:function(){
	         }
		})
    }
    function wjmmsettime(obj) { //发送验证码倒计时
        if (wjmmcountdown == 0) {
            obj.attr('disabled',false);
            obj.val("重新获取");
            wjmmcountdown = 60;
            return;
        } else {
            obj.attr('disabled',true);
            obj.val(wjmmcountdown+"s");
            wjmmcountdown--;
        }
        setTimeout(function() {
        	wjmmsettime(obj) 
       	},1000)
    }
</script>
</html>